package com.qpl.depression.service.impl;

import com.qpl.depression.entity.CategoryLevel;
import com.qpl.depression.repository.CategoryLevelRepository;
import com.qpl.depression.repository.CategoryRepository;
import com.qpl.depression.service.CategoryLevelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author qpl
 * @since 2021-05-16
 */
@Service
public class CategoryLevelServiceImpl extends ServiceImpl<CategoryLevelRepository, CategoryLevel> implements CategoryLevelService {

    @Autowired
    private CategoryLevelRepository categoryLevelRepository;

    /**
     * 通过分数Id和分数查询试卷等级
     *
     * @param categoryId 分类id
     * @param scope      分数
     * @return 查询结果
     */
    @Override
    public List<CategoryLevel> getByScope(Long categoryId, BigDecimal scope) {
        return categoryLevelRepository.getByScope(categoryId, scope);
    }
}
